package com.liang.controller;

import com.liang.entity.Student;
import com.liang.feign.FeignProviderClient;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Collection;

/**
 * Created with Intellij IDEA
 *
 * @Auther: liangjy
 * @Date: 2021/12/24/14:25
 * @Description:
 */

@RestController
@RequestMapping("/hystrix")
public class HystrixHandler {
    @Autowired
    private FeignProviderClient feignservice;

    @GetMapping("/findAll")
    public Collection<Student> findAll(){
        return feignservice.findAll();
    }

    @GetMapping("/index")
    public String index() {
        return feignservice.index();
    }
}
